package com.zx.map.service;

import com.zx.map.service.model.BaseAcctInfoModel;
import com.zx.map.service.model.MerchantInfoModel;
import org.springframework.dao.DataAccessException;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

/**
 * Created by IntelliJ IDEA. User: Administrator Date: 14-3-1 Time: 上午11:06 To
 * change this template use File | Settings | File Templates.
 */
public interface BaseAcctInfoService {

    /**
     * 查找所有数据列表
     *
     * @return
     * @throws DataAccessException
     */
    public List<BaseAcctInfoModel> getAllList() throws DataAccessException;

    /**
     * 根据单Key查找Model
     *
     * @param key
     * @return
     * @throws DataAccessException
     */
    public BaseAcctInfoModel getModelByKey(String key) throws DataAccessException;

    /**
     * 根据单Key查找Model 同时增加行锁
     *
     * @param key
     * @return
     * @throws DataAccessException
     */
    public BaseAcctInfoModel getModelByKeyAndLineLock(String key) throws DataAccessException;

    /**
     * 根据Model查找列表
     *
     * @param model
     * @return
     * @throws DataAccessException
     */
    public List<BaseAcctInfoModel> getListByModel(BaseAcctInfoModel model) throws DataAccessException;


    /**
     * 新增并返回主键
     *
     * @param model
     * @return
     * @throws DataAccessException
     */
    public String add(BaseAcctInfoModel model) throws DataAccessException;

    /**
     * 更新并返回主键
     *
     * @param model
     * @throws DataAccessException
     */
    public String update(BaseAcctInfoModel model) throws DataAccessException;

    /**
     * 删除
     *
     * @param model
     * @return
     * @throws DataAccessException
     */
    public void delete(BaseAcctInfoModel model) throws DataAccessException;

    /**
     * 分页查询
     *
     * @param pageSize
     * @param pageNum
     * @param domain
     * @return
     * @throws DataAccessException
     */
    public Map<String, Object> getPageByDomain(int pageSize, int pageNum, BaseAcctInfoModel domain)
            throws DataAccessException;

	Map<String, Object> queryPageByDomain(MerchantInfoModel searchMerchantInfoModel, BaseAcctInfoModel domain, int pageSize, int pageNum)
	        throws DataAccessException;

	/**
     * 根据单Key查找Model
     *
     * @param settleAmt
     * @param model
     * @return
     * @throws DataAccessException
     */
    public BaseAcctInfoModel addBaseAcctBalByKeyModel(BigDecimal settleAmt, BaseAcctInfoModel model) throws DataAccessException;

    /**
     * 对于指定用户冻结账户余额
     */
    public BaseAcctInfoModel frzBaseAcctBalByKey(BigDecimal settleAmt, String key)
            throws DataAccessException;

    /**
     * 对于指定用户解冻账户余额
     */
    public BaseAcctInfoModel deFrzBaseAcctBalByKey(BigDecimal settleAmt, String key)
            throws DataAccessException;

}
